<!DOCTYPE html>
<html>
<head>
    <title>Function Type this Example</title>
    <script type="text/javascript">
        
        window.color = "red";
        var o = { color: "blue" };
        
        function sayColor(){
            alert(this.color);
        }
        
        sayColor();     //red
        
        o.sayColor = sayColor;
        o.sayColor();   //blue



    </script>
</head>
<body>

</body>
</html>